<template>
	<view class="container">
		<view class="owner-info">
			<image class="bg" src="https://edsfiles.oss-cn-shenzhen.aliyuncs.com/eds/%E5%BE%AE%E4%BF%A1%E5%9B%BE%E7%89%87_20191010160210.png"></image>
			<view class="info-l">
				<image :src="owner.user.avatar" mode=""></image>
				<view class="user-info">
					<text>{{ owner.user.nickname }}</text>
					<button>{{ owner.level.owner_level_name }}</button>
				</view>
			</view>
			<view class="info-r">
				<text class="info-r-o">财务信息</text>
				<text>可用现金</text>
				<text>￥{{ owner.user.item.balance }}</text>
			</view>
		</view>

		<!-- 店铺信息 -->
		<view class="shop-num">
			<view class="shop-tit">
				<text>已转出</text>
				<text class="bor">未转出</text>
				<text>全部店铺</text>
			</view>
			<view class="shop-n">
				<text>{{ transfer }}</text>
				<text class="bor">{{ owner.shops_num }}</text>
				<text>{{ owner.shops_max }}</text>
			</view>
		</view>

		<!-- 管理项目 -->
		<view class="info-admin">
			<view class="Administration">
				<text class="text-tit">业主管理</text>
				<view class="Choice">
					<view class="single" @click="navTo('/pages/owner/storemanagement')">
						<text class="single-tit">店铺管理</text>
						<text class="yticon icon-you"></text>
					</view>
					<view class="single" @click="navTo('/pages/owner/mytm')">
						<text class="single-tit">我的团队</text>
						<text class="yticon icon-you"></text>
					</view>
					<view class="single" @click="navTo('/pages/owner/shopmember?name=Y')">
						<text class="single-tit">店铺会员</text>
						<text class="yticon icon-you"></text>
					</view>
					<view class="single" @click="navTo('/pages/owner/shopmember?name=N')">
						<text class="single-tit">店铺过期会员管理</text>
						<text class="yticon icon-you"></text>
					</view>
				</view>
			</view>

			<view class="Administration">
				<text class="text-tit">店铺收益</text>
				<view class="Choice">
					<view class="single" @click="navTo('/pages/owner/rentprofit')">
						<text class="single-tit">推荐购物返利记录</text>
						<text class="yticon icon-you"></text>
					</view>
					<view class="single" @click="navTo('/pages/owner/shopprofit')">
						<text class="single-tit">租金返利记录</text>
						<text class="yticon icon-you"></text>
					</view>
					<view class="single" @click="cash()">
						<text class="single-tit">提现</text>
						<text class="yticon icon-you"></text>
					</view>
				</view>
			</view>

			<!-- 	<view class="Administration" style="margin-bottom: 40rpx;">
					<text class="text-tit">营销推广</text>
					<view class="Choice">
						<view class="single" @click="navTo('/pages/owner/ownerth')">
							<text class="single-tit">分享成为业主</text>
							<text class="yticon icon-you"></text>
						</view>
						<view class="single" @click="navTo('/pages/owner/tenant')">
							<text class="single-tit">分享成为店主</text>
							<text class="yticon icon-you"></text>
						</view>
						
					</view>
				</view> -->
		</view>
	</view>
</template>

<script>
import uniIcons from '../../ed-icons/ed-icons.vue'
import { getOne } from '../../api/publicapi.js'
export default {
	components: {
		uniIcons
	},
	data() {
		return {
			select: ' bill_select',
			selectfles: 'top_item ',
			owner: []
		};
	},
	computed: {
		transfer: function() {
			let transferNum = this.owner.shops_max - this.owner.shops_num
			return transferNum
		}
	},
	onShow() {
		this.getownerinfo()
	},
	methods: {
		getownerinfo() {
			getOne('front/owner').then(res => {
				this.owner = res
			});
		},
		navTo(url) {
			uni.navigateTo({
				url
			});
		},
		cash() {
			uni.showModal({
				content: '该功能正在内测中！',
				showCancel: false
			});
		}
	}
};
</script>
<style lang="scss">
page {
	background: #f7f7f7;
}
.owner-info {
	width: 92%;
	margin: 0 auto;
	display: flex;
	justify-content: space-between;
	padding-top: 80upx;

	.info-l {
		// width: 35%;
		display: flex;
		justify-content: space-between;
		position: relative;

		image {
			width: 124upx;
			height: 124upx;
			border-radius: 50%;
		}
		.user-info {
			margin-left: 23upx;

			text {
				font-size: 33upx;
				color: #fff;
			}
			button {
				border: 0;
				background: #d23931;
				border-radius: 21px;
				font-size: 23upx;
				color: #ffffff;
				height: 40upx;
				line-height: 40upx;
				margin-top: 25upx;
			}
		}
	}

	.info-r {
		width: 22%;
		text-align: center;
		line-height: 29upx;

		text {
			font-size: 26upx;
			color: #fff;
		}
		.info-r-o {
			font-size: 33upx;
			margin-bottom: 16px;
			display: block;
		}
	}
	.bg {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		height: 380upx;
		filter: blur(1px);
		z-index: -1;
	}
}

.shop-num {
	width: 92%;
	margin: 0 auto;
	text-align: center;
	background: #fff;
	border-radius: 25upx;
	margin-top: 65upx;

	text {
		width: 33.33%;
		font-size: 30upx;
		padding: 35upx 0;
	}

	.bor {
		border-left: 1px solid #eee;
		border-right: 1px solid #eee;
	}

	.shop-tit {
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid #eee;
	}

	.shop-n {
		display: flex;
		justify-content: space-between;
	}
}

// 管理信息
.Administration {
	width: 95%;
	margin: 0 auto;

	.text-tit {
		display: block;
		padding: 20upx 0;
		font-weight: bold;
		margin-left: 20upx;
	}

	text {
		font-size: 28upx;
	}

	.Choice {
		background: #fff;
	}

	.single {
		width: 100%;
		display: flex;
		justify-content: space-between;
		border-bottom: 1px solid #dfdfdf;

		.single-tit {
			display: block;
			padding: 15upx 0;
			margin-left: 20upx;
			color: #585858;
		}

		.yticon {
			padding-top: 20upx;
		}
	}
}
</style>
